var t = require("../../@babel/runtime/helpers/interopRequireDefault").default, e = t(require("../../kta/index")), i = t(require("../../api/api_YQYL_hf.js")), a = t(require("../../api/auth.js")), s = require("../../config/Links"), n = require("../../utils/YQYL");

e.default.Page({
    data: {
        options: {},
        activity_info: {},
        succeedUser: [],
        shareUrl: "",
        poster: null,
        showPoster: !1,
        imgBaseUrl: s.imageBaseUrl.YQYL_hf,
        postUtil: {
            handleSharePoster: function() {}
        },
        userStatus: ""
    },
    onShareAppMessage: function() {
        return (0, n.handleShare)(this, "hf");
    },
    onLoad: function(t) {
        this.setData({
            options: t
        }), this.init();
    },
    init: function() {
        var t = this;
        (0, n.initPage)(this, this.data.options, "hf").then(function(e) {
            t.setUserStatus(e);
        }), i.default.getSucceedUser().then(function(e) {
            t.setData({
                succeedUser: e.successRecordList
            });
        });
    },
    setUserStatus: function(t) {
        var e = "";
        e = t.phone ? t.invite_url ? "WK" : "NoWK" : "NoBind", this.setData({
            userStatus: e
        });
    },
    bindgetphonenumber: function(t) {
        var e = this;
        t.detail.iv && t.detail.encryptedData && a.default.auth({
            source: 2,
            encryptedData: t.detail.encryptedData,
            iv: t.detail.iv
        }).then(function() {
            e.init();
        });
    },
    checkWK: function() {
        return "WK" === this.data.userStatus || (wx.showModal({
            showCancel: !1,
            content: "活动仅限王卡用户参与！（亲情卡除外）"
        }), !1);
    },
    handlePoster: function() {
        this.checkWK() && (this.data.poster ? this.setData({
            showPoster: !0
        }) : this.data.postUtil.handleSharePoster());
    },
    toRecordPage: function() {
        this.checkWK() && (0, n.toHFRecordPage)();
    },
    toRulePage: function() {
        (0, n.toHFRulePage)();
    },
    closePoster: function() {
        this.setData({
            showPoster: !1
        });
    }
});